<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<h:outputStylesheet library="css" name="default.css" target="head" />

	<title>Modifica Pacchetti</title>
<style>
.fixed-size {
    table-layout: fixed;
    word-wrap: break-word;
}
</style>
</h:head>
<h:body>
	<p:button value="Indietro"
		outcome="index.xhtml?faces-redirect=true" />
	<h:form id="form">
	<h:outputLabel>Pacchetti</h:outputLabel><br/>
	<h:message for="generic_error" /><br/>
	<h:message for="create_update_pack" errorClass="error" id="create_update_pack"/>
	<p:dataTable value="#{packPresBean.getAllPacchetti()}" var="pacc" id="packs">
	
		<f:facet name="header">  
			Elenco Pacchetti 
			<div align="right">
			<p:button value="Aggiungi" outcome="edit_pacchetti.xhtml?nuovo=true" icon="ui-icon-plusthick"/>
			</div>
		</f:facet>
		
		<p:column headerText="ID">
			<h:outputText value="#{pacc.ID}" />
		</p:column>
		
		<p:column headerText="Nome">
			<h:outputText value="#{pacc.nome}" />
		</p:column>
		
		<p:column headerText="Descrizione">
			<h:outputText value="#{pacc.descrizione}" />
		</p:column>

		<p:column headerText="Pub" style="width:50px">
			<div align="center">
			<p:selectBooleanCheckbox value = "#{pacc.pubblico}" disabled="true"/>
			</div>
		</p:column>

		
		<p:column style="width:190px">
			<!-- <f:facet name="header">Modifica</f:facet>-->
			<div align="center">
			<p:button style="margin-right:10px" icon="ui-icon-pencil" value="Modifica" outcome="edit_pacchetti.xhtml?nuovo=false&amp;ID=#{pacc.ID}" update=":form:packs"/>
			<p:commandButton icon="ui-icon-closethick" value = "Elimina" action="#{packPresBean.deletePaccheto(pacc.IDPacchetto)}" update=":form:packs"/>
			</div>
		</p:column>
	</p:dataTable>
</h:form>
	
</h:body>
</html>